package com.bvgol.quartzDemo.job;

import cn.hutool.core.date.DateUtil;
import org.quartz.JobExecutionContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.util.Date;
import java.util.StringJoiner;

public class HelloJob2 extends QuartzJobBean {
    @Override
    protected void executeInternal(JobExecutionContext context)  {
        StringJoiner joiner = new StringJoiner(" | ")
                .add("---HelloJob---")
                .add(context.getTrigger().getKey().getName())
                .add(DateUtil.formatDateTime(new Date()));
        System.out.println(joiner);
//定时执行的语句
    }
}
